package cn.myframe.controller;

import com.alibaba.nacos.api.config.annotation.NacosValue;
import com.alibaba.nacos.spring.context.annotation.config.NacosPropertySource;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

/*******************
 *@Describe
 *@author 封神梦
 *@Time 2022/12/12
 *@Company http://com.yiview.com
 ****************/
@RestController
@NacosPropertySource(dataId = "elasticsearch_url", autoRefreshed = true)
public class ConfigController {


    @NacosValue(value = "${spring.elasticsearch.rest.uris:http://127.0.0.1:9200}", autoRefreshed = true)
    private String elasticsearchUrl;




    @RequestMapping(value = "/elasticsearch_url")
    @ResponseBody
    public String get() {
        return elasticsearchUrl;
    }
}
